import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import '@/assets/css/global.css'
import store from '@/store/index.js'
import md5 from 'js-md5'
// import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
import { Notification } from 'element-ui'
Vue.config.productionTip = false

// 设置字节转kb\mb的过滤器
Vue.filter('bit', function (originSize) {
  if (originSize < 1024) {
    return originSize + ' byte'
  }
  // 否则大于1024字节，换成kb计算
  if (originSize < 1048576) {
    const fixed1 = originSize / 1024
    return fixed1.toFixed(2) + ' KB'
  }
  // 否则按mb计算
  const fixed2 = originSize / 1048576
  return fixed2.toFixed(2) + ' MB'
})
// 绑定elementui提示框
Vue.prototype.$notify = Notification
// 绑定md5加密库
Vue.prototype.$md5 = md5

new Vue({
  router,
  render: h => h(App),
  store
}).$mount('#app')
